const cloud = require('wx-server-sdk')

cloud.init({
    env:"agriculture-4g9roniha194f9d1"
})
const db = cloud.database();
// 云函数入口函数
exports.main = async (event, context) => {
    var tool = event.tool
    return await db.collection("tool").add({
        //直接封装成为对象，传递给数据库
        data :tool
      })
}